
import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker/flutter_picker.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/CustomDialog.dart';
//第一类item
class labelSelectItem extends StatefulWidget {
  String title;
  String hitText;
  bool isflag;
  final Function onTapCallback;
  labelSelectItem({this.onTapCallback, this.title,this.hitText,this.isflag =false,Key key}) : super(key: key);
  @override
  _labelSelectItemState createState() => _labelSelectItemState();
}

class _labelSelectItemState extends State<labelSelectItem> {

  @override
  Widget build(BuildContext context) {
    return Container(
        color:Colors.white,
        width: ScreenUtil.screenWidth,
        height: ScreenUtil().setWidth(50),
        child:Column(
          children: [
            InkWell(
              onTap: (){
                widget.onTapCallback();
              },
              child:Container(height: ScreenUtil().setWidth(49),
                child:Row(
                  children: [
                    SizedBox(width:ScreenUtil().setWidth(14) ,),
                    Stack(
                      children: [
                        Container(
                          width: ScreenUtil().setWidth(80),
                          child:Text(widget.title,style: TextStyle(fontSize: ScreenUtil().setSp(15),color:Color(0xff888888)),textAlign: TextAlign.left,),

                        ),
                        widget.isflag?
                            Positioned(
                                top: ScreenUtil().setWidth(3),
                                right:0,
                                child: InkWell(
                                  onTap: (){
                                    PopMenus.showPop(context: context,
                                        selText: '选择放款和自动还款的银行卡，之前的贷款业务的放款卡将更换为新选择的银行卡', clickCallback: (int index, String value){

                                        });
                                  },
                                  child: Container(child: Image.asset("sources/yy/gantan.png"),width: ScreenUtil().setWidth(16),height:ScreenUtil().setWidth(16),),)
                            ) :Container(width: 0,height: 0,)
                      ],
                    ),

                   SizedBox(width:ScreenUtil().setWidth(10) ,),
                    Container(
                      width: ScreenUtil().setWidth(200),
                      child:Text(widget.hitText,style: TextStyle(fontSize: ScreenUtil().setSp(15),color:Color(0xff333333)),textAlign: TextAlign.left,),
                    ),
                    SizedBox(width:ScreenUtil().setWidth(45) ,),
                    Container(
                      width: ScreenUtil().setWidth(8),
                      height: ScreenUtil().setWidth(14),
                      child: Image.asset("sources/yy/rightArrown.png"),
                    )
                  ],
                ),
              ),
            ),
            Container(height: ScreenUtil().setWidth(0.5),width: ScreenUtil.screenWidth,color: Color(0xffD8D8D8),),
          ],
        )
    );
  }
}